package mt.client;

import static org.junit.Assert.*;

import java.util.LinkedList;

import javax.swing.AbstractButton;
import javax.swing.JTextField;

import mt.Order;
import mt.dummy.ClientCommDummy;
import mt.dummy.MicroTraderClientDummy;

import org.junit.Test;

public class GUITest {

	@Test
	public void testGUI() {
		ClientCommDummy client = new ClientCommDummy();
		GUI gui = new GUI(client);

	}

	@Test
	public void testMain() {
		ClientCommDummy client = new ClientCommDummy();
		GUI gui = new GUI(client);

	}

	@Test
	public void testInsertHistorico() {
		ClientCommDummy client = new ClientCommDummy();
		GUI gui = new GUI(client);

		LinkedList<Order> list = new LinkedList<Order>();
		Order o1 = Order.createBuyOrder("tony", "ze", 20, 1);
		Order o2 = Order.createSellOrder("didi", "ze", 20, 1);
		Order o3 = Order.createBuyOrder("sam", "ze", 20, 1);
		Order o4 = Order.createSellOrder("tony2", "ze", 20, 1);
		Order o5 = Order.createBuyOrder("", "ze", 20, 1);

		list.add(o1);
		list.add(o2);
		list.add(o3);
		list.add(o4);
		list.add(o5);

		gui.insertHistorico(list);



	}

	@Test
	public void testShowMessages() {
		ClientCommDummy client = new ClientCommDummy();
		GUI gui = new GUI(client);

		LinkedList<Order> list = new LinkedList<Order>();
		Order o1 = Order.createBuyOrder("tony", "ze", 20, 1);
		Order o2 = Order.createSellOrder("didi", "ze", 20, 1);
		Order o3 = Order.createBuyOrder("sam", "ze", 20, 1);
		Order o4 = Order.createSellOrder("tony2", "ze", 20, 1);
		Order o5 = Order.createBuyOrder("tony1", "ze", 20, 1);
		Order o6 = Order.createBuyOrder("", "ze", 20, 1);

		list.add(o1);
		list.add(o2);
		list.add(o3);
		list.add(o4);
		list.add(o5);
		list.add(o6);
		gui.showMessages(list);

	}

	@Test
	public void testRun() {
		ClientCommDummy client = new ClientCommDummy();
		GUI gui = new GUI(client);

		gui.run();

	}


}